<template>
	<view class="content">
		<rich-text :nodes="nodes"></rich-text>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				nodes:"",
				field: '',
				title: ''
			}
		},
		onLoad(options){
			let field = options.title;
			this.field = field;
			let title = '服务协议';
			title = field === 'service' ? '服务协议' : field === 'privacy' ? '隐私政策' : field === 'user_instructions' ? '用户协议': '关于我们';
			this.title = title;
			this.init();
		},
		onReady() {
			uni.setNavigationBarTitle({
				title: this.title
			});
		},
		methods: {
			init(){
				this.$http.post('api/user/config',{
					field: this.field
				}).then(res =>{
					console.log(res)
					this.nodes = res;
				})
			}
		}
	}
</script>

<style>
	.content{
		font-size: 13px; line-height: 22px; padding: 12px;
	}
</style>
